package com.summer_administration.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
public class Groupe {
    private Integer id;

    //@NotBlank(message = "小组ID不能为空")
    //@Size(max = 2, message = "小组ID长度不能超过2位")
    private String groupId;

    @NotBlank(message = "小组名称不能为空")
    @Size(max = 32, message = "小组名称长度不能超过32位")
    private String groupName;

    @NotBlank(message = "小组属性不能为空")
    @Pattern(regexp = "固定|临时", message = "小组属性必须为固定或临时")
    private String groupAttr;

    @NotNull(message = "小组人数不能为空")
    @Min(value = 1, message = "小组人数至少1人")
    @Max(value = 5, message = "小组人数最多5人")
    private Integer memberNum;

    @NotBlank(message = "组长不能为空")
    private String leader;

    private String member1 = "无";
    private String member2 = "无";
    private String member3 = "无";
    private String member4 = "无";

    private Integer createUser;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}